package com.huaxin.dao;

import java.util.List;

import org.huaxin.commons.dao.BaseDAO;
import org.huaxin.commons.values.ConstantOfHQL;
import org.springframework.stereotype.Repository;

import com.huaxin.domain.StudentEntity;

/**
 * StudentEntity持久层操作类
 * 
 * @author 薛琪
 * 
 */
@Repository
public class StudentDAO extends BaseDAO<StudentEntity> {
	/**
	 * 根据学号查询学生信息
	 * 
	 * @param userName
	 * @return
	 */
	public StudentEntity queryByUserNum(String userName) {
		StudentEntity studentEntity = null;
		List list = queryByHQL(ConstantOfHQL.QUERY_STUDENT_BY_NUM, userName);
		if(list.size() > 0) {
			studentEntity = (StudentEntity) list.get(0);
		}
		return studentEntity;
	}
}
